package com.dgj.wx.module;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.IocBy;
import org.nutz.mvc.annotation.Modules;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Views;
import org.nutz.mvc.ioc.provider.ComboIocProvider;

import com.dgj.nutz.module.base.AbstractBaseModule;
import com.dgj.nutz.velocity.VelocityViewMaker;
import com.dgj.utils.entries.Result;
import com.dgj.wx.service.test.ITestService;

/**
 * 主模块
 * 
 * @author wkipy
 *
 */
@Modules(scanPackage = true)
@IocBy(type = ComboIocProvider.class, args = { "*js", "conf", "*anno", "com.dgj", "*com.dgj.nutz.ioc.DGJProjectLoader" })
@Views({ VelocityViewMaker.class })
public class MainModule extends AbstractBaseModule {

	@Inject
	private ITestService testService;

	@Override
	public String _getNameSpace() {
		return "main";
	}

	@At
	@Ok("vel:test.html")
	public Result test() {
		return Result.success().addData("test", testService.findName());
	}
}
